<!doctype html>
<html lang="zh-han">
  <head>
    <title>Hugo搭建个人博客 // 小田博客</title>
    <link rel="shortcut icon" href="/favicon.ico" />
    <meta charset="utf-8" />
    <meta name="generator" content="Hugo 0.68.3" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="author" content="John Doe" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="https://tian_828.gitee.io/css/main.min.4a7ec8660f9a44b08c4da97c5f2e31b1192df1d4d0322e65c0dbbc6ecb1b863f.css" />

    
    <meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Hugo搭建个人博客"/>
<meta name="twitter:description" content="安装git
sudo apt-get install git 安装hugo
sudo apt-get install hugo 创建hugo 项目
hugo new site myblog 克隆一个主题
cd myblog git clone https://github.com/vaga/hugo-theme-m10c.git themes/m10c 本地启动
hugo server -t m10c --buildDrafts 新建一个博客
hugo new post/blog.md 修改配置文件
baseURL = &quot;https://tian_828.gitee.io/&quot; languageCode = &quot;zh-han&quot; title = &quot;小田博客&quot; theme = &quot;m10c&quot; 或者部署到远程
hugo --theme=m10c --baseURL=&#34;https://cjj.github.io&#34; --buildDrafts 编译
hugo -D 将生成public文件夹推到远程仓库
cd public/ git init git commit -m &#34; &#34; git push -u origin master "/>

    <meta property="og:title" content="Hugo搭建个人博客" />
<meta property="og:description" content="安装git
sudo apt-get install git 安装hugo
sudo apt-get install hugo 创建hugo 项目
hugo new site myblog 克隆一个主题
cd myblog git clone https://github.com/vaga/hugo-theme-m10c.git themes/m10c 本地启动
hugo server -t m10c --buildDrafts 新建一个博客
hugo new post/blog.md 修改配置文件
baseURL = &quot;https://tian_828.gitee.io/&quot; languageCode = &quot;zh-han&quot; title = &quot;小田博客&quot; theme = &quot;m10c&quot; 或者部署到远程
hugo --theme=m10c --baseURL=&#34;https://cjj.github.io&#34; --buildDrafts 编译
hugo -D 将生成public文件夹推到远程仓库
cd public/ git init git commit -m &#34; &#34; git push -u origin master " />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://tian_828.gitee.io/post/hugo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" />
<meta property="article:published_time" content="2021-04-23T21:15:22+08:00" />
<meta property="article:modified_time" content="2021-04-23T21:15:22+08:00" />


  </head>
  <body>
    <header class="app-header">
      <a href="https://tian_828.gitee.io/"><img class="app-header-avatar" src="/avatar.jpg" alt="John Doe" /></a>
      <h1>小田博客</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium.</p>
    </header>
    <main class="app-container">
      
  <article class="post">
    <header class="post-header">
      <h1 class ="post-title">Hugo搭建个人博客</h1>
      <div class="post-meta">
        <div>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
  <title>calendar</title>
  <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
          Apr 23, 2021
        </div>
        <div>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
  <title>clock</title>
  <circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
          1 min read
        </div>
      </div>
    </header>
    <div class="post-content">
      <p>安装git</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">sudo apt-get install git
</code></pre></div><p>安装hugo</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">sudo apt-get install hugo
</code></pre></div><p>创建hugo 项目</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">hugo new site myblog
</code></pre></div><p>克隆一个主题</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cd myblog
git clone https://github.com/vaga/hugo-theme-m10c.git themes/m10c
</code></pre></div><p>本地启动</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">hugo server -t m10c --buildDrafts
</code></pre></div><p>新建一个博客</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">hugo new post/blog.md
</code></pre></div><p>修改配置文件</p>
<pre><code>baseURL = &quot;https://tian_828.gitee.io/&quot;
languageCode = &quot;zh-han&quot;
title = &quot;小田博客&quot;
theme = &quot;m10c&quot;
</code></pre><p>或者部署到远程</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">hugo --theme<span style="color:#f92672">=</span>m10c --baseURL<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://cjj.github.io&#34;</span> --buildDrafts
</code></pre></div><p>编译</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">hugo -D
</code></pre></div><p>将生成public文件夹推到远程仓库</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cd public/
git init
git commit -m <span style="color:#e6db74">&#34; &#34;</span>
git push -u origin master
</code></pre></div>
    </div>
    <div class="post-footer">
      
    </div>
  </article>

    </main>
  </body>
</html>
